package game.block.turn;

import game.block.command.Command;

import java.util.ArrayList;

public class Turn {

    private ArrayList<Command> commands;
    
    public Turn(){
        commands=new ArrayList<Command>();
    }
    
    public void addCommand(Command c){
        commands.add(c);
    }
    
    public void execute(){
        for(int i=0; i<commands.size(); i++){
            commands.get(i).execute();
        }
    }
    
    public void undo(){
        for(int i=commands.size()-1; i>=0; i--){
            commands.get(i).undo();
        }
    }
    
    public int getSize(){
        return commands.size();
    }
    
    
}
